home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2003 May / cmycha200305.iso / MutantStorm / setup_mutantstorm_demo.exe / {app} / script / actor_place.lua < prev    next >
Text File  |  2002-10-19  |  2KB  |  80 lines

  1.  
  2. function actor_plopper( act, act_count, act_length, time_delay, posx1, posx2, posy1, posy2, rotate, siz, path )
  3.     if act_count > 0.0 then
  4.         local posx = 0.0
  5.         local posy = 0.0
  6.         local posz = 0.0
  7.         local hue = 0.0
  8.         local rot = rotate
  9.         local unique_name = nil
  10.         local launch_delay = 0.0
  11.         local launch_delay_inc = time_delay / act_count
  12.  
  13.         if act == "chunk" then
  14.             act = current_chunk
  15.         end
  16.  
  17.         if act == "turret-base" then
  18.             posx = c_zrand(posx1,posx2)
  19.             posy = c_zrand(posy1,posy2)
  20.             hue = c_zrand(-25.0,25.0)
  21.             if rotate == -90 then
  22.                 rot = c_zrand(-180.0,180.0)
  23.             end
  24.             turret_base_plop( act, posx, posy, posz, rot, siz, hue, 0.0, path )
  25.         else
  26.             local turret_emerge_actor_size = 90.0
  27.  
  28.             if act == "turret-1_sma" or act == "turret-1_med" or act == "turret-1_big" then
  29.                 if path ~= nil then
  30.                     unique_name = format( "turret-base_%s", path )
  31.                     path = nil
  32.                 end
  33.                 if act == "turret-1_sma" then
  34.                     turret_emerge_actor_size = 70.0
  35.                 end
  36.                 if act == "turret-1_big" then
  37.                     turret_emerge_actor_size = 110.0
  38.                 end
  39.             end
  40.  
  41.             for c = 1, act_count, 1 do
  42.                 posx = c_zrand(posx1,posx2)
  43.                 posy = c_zrand(posy1,posy2)
  44.                 hue = c_zrand(-25.0,25.0)
  45.                 if rotate == -90 then
  46.                     rot = c_zrand(-180.0,180.0)
  47.                 end
  48.  
  49.                 if act == "geopus" then
  50.                     geopus_actor_plop( act, act_length, posx, posy, posz, rot, siz, hue, path )
  51.                 elseif act == "worm_chain_split" then
  52.                     worm_chain_split_plop( act, act_length, posx, posy, posz, rot, siz, hue, path )
  53.                 else
  54.  
  55.                     local apo = ACTOR_PreLaunch( act )
  56.                     apo:setall( posy, posz, -posx, rot, siz, hue, launch_delay, path )
  57.                     apo:launch()
  58.  
  59.                     if unique_name ~= nil then
  60. --                        c_print( unique_name )
  61.                         c_link_health_to_parent( unique_name )
  62.                     end
  63.  
  64.                     if act == "turret-1_sma" or act == "turret-1_med" or act == "turret-1_big" then
  65.                         apo = ACTOR_PreLaunch( turret_emerge_actor_name )
  66.                         apo:setall( posy, posz, -posx, rot, turret_emerge_actor_size, hue, launch_delay )
  67.                         apo:launch()
  68.                     elseif act == "powerpimp" then
  69.                         apo = ACTOR_PreLaunch( powerpimp_emerge_actor_name )
  70.                         apo:setall( posy, posz, -posx, rot, siz, hue, launch_delay )
  71.                         apo:launch()
  72.                     end
  73.                 end
  74.  
  75.                 launch_delay = launch_delay + launch_delay_inc
  76.             end
  77.         end
  78.     end
  79. end
  80.